<?php
/**
 * Created by PhpStorm.
 * User: Liuxc
 * Date: 2022/07/14
 * Time: 14:58
 */

namespace business\elasticsearch\types;

class BigDataPurchaseMapConfigType
{
    /**
     * mapping配置
     * @return array
     */
    public static function mapConfig()
    {
        return [
            'properties' => [
                'organizing_code'   => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'title'           => ['type' => 'text', 'analyzer' => 'ik_max_word'],
//                'number_of_employees'   => ['type' => 'integer'],
                'uid'    => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'developer_name'    => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'detail'    => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'ower'      => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'ower_mobile'        => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'agent_organization'       => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'agent_ower'          => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'agent_ower_mobile'          => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'url'          => [
                    'type'   => 'text',
                ],
                'data_source'          => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'data_source_code'          => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'id'          => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'bidding_service_category'          => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'company_type'          => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'end_time'    => [
                    'type'   => 'date',
                    'format' => 'yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis'
                ],
                'publish_time'        => [
                    'type'   => 'date',
                    'format' => 'yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis'
                ],
                "projects"                 => [
                    'type'       => 'nested',
                    'properties' => [
                        'project_name' => [
                            'type'   => 'text',
                            'fields' => [
                                'keyword' => [
                                    'ignore_above' => 256,
                                    'type'         => 'keyword'
                                ]
                            ]
                        ],
                        'province'     => [
                            'type'   => 'text',
                            'fields' => [
                                'keyword' => [
                                    'ignore_above' => 256,
                                    'type'         => 'keyword'
                                ]
                            ]
                        ],
                        'city'     => [
                            'type'   => 'text',
                            'fields' => [
                                'keyword' => [
                                    'ignore_above' => 256,
                                    'type'         => 'keyword'
                                ]
                            ]
                        ],
                        'province_code'     => [
                            'type'   => 'text',
                            'fields' => [
                                'keyword' => [
                                    'ignore_above' => 256,
                                    'type'         => 'keyword'
                                ]
                            ]
                        ],
                        'city_code'     => [
                            'type'   => 'text',
                            'fields' => [
                                'keyword' => [
                                    'ignore_above' => 256,
                                    'type'         => 'keyword'
                                ]
                            ]
                        ]
                    ]
                ]
            ]
        ];
    }
}
